#!/bin/bash
GreenBG="\\033[42;37m"
Info="${GreenBG}[信息]${Font}"
Font="\\033[0m"
echo -e "\n ================ \n ${Info} ${GreenBG} 即将检查此项目更新 ${Font} \n ================ \n"
git pull
echo -e "\n ================ \n ${Info} ${GreenBG} 即将安装lx-sync-server ${Font} \n ================ \n"
if [[ ! -d "./data" ]]; then
    mkdir -p ./data
fi
if [[ ! -d "./log" ]]; then
    mkdir -p ./log
fi
if [[ ! -d "./server" ]]; then
    mkdir -p ./server
fi
if [[ ! -d "./nginx/logs" ]]; then
    mkdir -p ./nginx/logs
fi
if [[ ! -d "./nginx/ssl/cert.crt" ]]; then
    touch ./nginx/ssl/cert.crt
fi
if [[ ! -d "./nginx/ssl/cert.key" ]]; then
    touch ./nginx/ssl/cert.key
fi
docker-compose -f ./image.yaml up -d